#include <iostream>
#include "sylar/log.h"
#include <memory>

int main(void)
{
    sylar::Logger::LoggerPtr logPtr(new sylar::Logger);
    logPtr->AddAppender(sylar::BaseLogAppender::LogAppenderPtr(new sylar::StdOutLogAppender()));

    sylar::FileOutLoggAppender::LogAppenderPtr fileLog = std::make_shared<sylar::FileOutLoggAppender>("./log.txt");
    sylar::LogFormatter::LogFormatPtr fmt = std::make_shared<sylar::LogFormatter>("%d%T%p%T%m%n");
    fileLog->SetLogFormat(fmt);
    fileLog->SetLevel(sylar::LogLevel::ERROR);
    //logPtr->AddAppender(fileLog);
    
     
    //std::cout << "hello sylar log" << std::endl;

 
	SYLAR_LOG_INFO(logPtr) << "test macro";
	// SYLAR_LOG_ERROR(logPtr) << "test macro error";

	// SYLAR_LOG_FMT_ERROR(logPtr, "test macro fmt error %s", "aa");

	// auto l = sylar::LoggerMgr::GetInstance()->getLogger("xx");
	// SYLAR_LOG_INFO(l) << "xxx";
    

    return 0;
}
